package com.kong.provider1.service;

import com.kong.consulapi.domain.Pig;
import com.kong.consulapi.vo.BaseGenericOutputDTO;
import com.kong.consulapi.vo.BaseOutputDTO;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @author gedachao
 * @description
 * @date 2020-08-13 16:02
 */
@Service
public class TransferServiceImpl {
    public BaseOutputDTO getList1() {
        BaseOutputDTO outputDTO = new BaseOutputDTO();
        String str = "hello";
        outputDTO.setCode(200);
        outputDTO.setStatus("common");
        outputDTO.setResponseBody(str);
        return outputDTO;

    }

    public BaseOutputDTO getList() {
        BaseOutputDTO outputDTO = new BaseOutputDTO();
        Pig georgy = new Pig("georgy", 5, "zookeeper");
        Pig pepper = new Pig("pepper", 10, "zookeeper");
        List<Pig> pigList = Arrays.asList(georgy, pepper);
        outputDTO.setStatus("succ");
        outputDTO.setCode(200);
        outputDTO.setResponseBody(pigList);
        return outputDTO;
    }

    public BaseGenericOutputDTO getGenericList() {
        Pig georgy = new Pig("georgy", 5, "zookeeper");
        Pig pepper = new Pig("pepper", 10, "zookeeper");
        List<Pig> pigList = Arrays.asList(georgy, pepper);
        BaseGenericOutputDTO<List<Pig>> outputDTO = new BaseGenericOutputDTO<>();
        outputDTO.setStatus("nomal");
        outputDTO.setCode(200);
        outputDTO.setData(pigList);
        return outputDTO;
    }
}
